/*
 * Copyright (c) 2011-2012  Cristian Constantin
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * @author Cristian Constantin
 * @since 1/3/12
 */
Ext.define('Quizio.view.Viewport', {
    extend: 'Ext.container.Viewport',
    layout: 'border',

    defaults: {
        border: false
    },

    initComponent: function() {
        this.items = [
            {
                region: 'north',
                title: 'Quizio'
            },
            {
                region: 'south',
                baseCls: 'x-plain',
                cls: 'copyright-info',
                html: 'Copyright &copy; 2012 quizio.com. All rights reserved.'
            },
            {
                region: 'east',
                border: false,
                title: 'Quiz player',
                width: 400,
                xtype: 'sessionslistpanel'
            },
            {
                region: 'center',
                layout: 'border',
                items: [
                    {
                        region: 'west',
                        items: [
                            {
                                xtype: 'actionpanel',
                                width: 160,
                                title: 'Quizes',
                                items: [
                                    {
                                        text: 'Create quiz',
                                        iconCls: 'create-quiz',
                                        action: 'create-quiz'
                                    },
                                    {
                                        text: 'Schedule quiz',
                                        iconCls: 'schedule-quiz',
                                        action: 'schedule'
                                    }
                                ]
                            },
                            {
                                xtype: 'actionpanel',
                                width: 160,
                                title: 'Administration',
                                items: [
                                    {
                                        text: 'Users',
                                        iconCls: 'create-quiz',
                                        action: 'create-quiz'
                                    }
                                ]
                            },
                            {
                                xtype: 'actionpanel',
                                width: 160,
                                title: 'My account',
                                items: [
                                    {
                                        text: 'Preferences',
                                        iconCls: 'create-quiz',
                                        url: 'j_spring_security_logout'
                                    },
                                    {
                                        text: 'Logout',
                                        iconCls: 'logout',
                                        url: 'j_spring_security_logout'
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        title: 'Workspace',
                        region: 'center'
                    }
                    /*
                     {
                     xtype: 'detailspanel',
                     width: 180,
                     title: 'Info',
                     summary: 'Cool',
                     paragraphs: ['Vestibulum semper. Nullam non odio. Aliquam quam. Mauris eu lectus non nunc auctor ullamcorper. Sed tincidunt molestie enim. Phasellus lobortis justo sit amet quam. Duis nulla erat, varius a, cursus in, tempor sollicitudin, mauris.']
                     }
                     */
                ]
            }
        ];

        this.callParent();
    }
});